package com.zhang.yunfu_his.rest;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.zhang.bingmei_incomeexpenditure.entity.commom.R;
import com.zhang.yunfu_his.entity.dbo.InquiryDoctorAdviceDO;
import com.zhang.yunfu_his.entity.req.PatientPrescriptionListREQ;
import com.zhang.yunfu_his.entity.ret.PatientPrescriptionVO;
import com.zhang.yunfu_his.service.PrescriptionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author zsj
 * @description
 * @createDate 2025/11/21 19:11
 * @Entity com.zhang.yunfu_his.rest.entity.
 */

@RestController
@Api(tags = "问诊处方相关接口")
@Slf4j
public class PrescriptionController {
    @Resource
    private PrescriptionService prescriptionService;

    @ApiOperation(value = "【测试】根据患者id查询病历医嘱表数据")
    @ApiOperationSupport(author = "zsj")
    @PostMapping("/inquiryDoctorAdviceList")
    public R<List<InquiryDoctorAdviceDO>> inquiryDoctorAdviceList(
            @Validated @RequestBody PatientPrescriptionListREQ req) {
        return prescriptionService.getInquiryDoctorAdviceList(req);
    }

    @ApiOperation(value = "【患者端】查询处方记录详情列表")
    @ApiOperationSupport(author = "zsj")
    @PostMapping("/patientPrescriptionList")
    public R<List<PatientPrescriptionVO>> getPatientPrescriptionList(
            @Validated @RequestBody PatientPrescriptionListREQ req) {
        return prescriptionService.getPatientPrescriptionList(req);
    }
}
